package com.bxn.thymeleaf_springboot.controller;

import com.bxn.thymeleaf_springboot.vo.UserVo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

@Controller
public class IndexController {
    @GetMapping("/basicTrain")
    public String basicTrain(Model model) {
        List<String> tags = new ArrayList<>();
        tags.add("你好");
        tags.add("我好");
        tags.add("大家好");
        tags.add("才是真的好");

        UserVo userVo = new UserVo();
        userVo.setName("小明");
        userVo.setAge(99);
        userVo.setVipUser(true);
        userVo.setSex(1);
        userVo.setTags(Arrays.asList("java","c","c++","PHP","JS"));
        userVo.setCreateTime(new Date());
        model.addAttribute("user",userVo);
        return "basic";

    }

}
